$(function () {

    laypage.dir = '/res/lib/laypage/skin/laypage.css ';

    function pageTable(list) {
        var str = '';
        for (var i = 0; i < list.length; i++) {
            str += '<tr data-id="' + list[i].id + '" >' +
                '<td>' + list[i].id + '</td>' +
                '<td>' + list[i].openId + '</td>' +
                '<td>' + list[i].nickName + '</td>' +
                '<td>' + list[i].totalIndent + '</td>' +
                '<td>' + new Date(list[i].createTime).format('yyyy-MM-dd hh:mm:ss') + '</td>' +
                '<td><a class="btn btn-primary btn-xs btn-state" href="#/member/address/'+ list[i].openId +'" >查看地址</a></td>' +
                '</tr>'
        }

        return str
    }


    var memberPage = new PageCreate({
        url:'/user/doPageQuery',
        container:$("#table tbody"),
        pagination:$("#page"),
        success:function (container,data,body) {
            container.html(pageTable(data.list))
        }
    });

    var init = function () {

        memberPage.init({
            pageNum: 1,
            pageSize: 10
        })
    }
    init()
});
